package com.finance.cooperate.dao.entity.primary;

import com.finance.cooperate.dao.support.pojo.BaseAutomaticSimpleVO;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @ClassName Borrowing
 * @Description 申请件关联借款表
 * @Author shen
 * @Date 2023/8/6 22:30
 * @Modify ...
 */
@Entity
@Table(name = "app_borrowing")
@Data
public class Borrowing extends BaseAutomaticSimpleVO {

    private static final long serialVersionUID = 7836873281397073292L;

    // ID
    @Id
    @Column(name = "id")
    private String id;

    // 借款次数
    @Column(name = "number")
    private Integer number;

    // 选择的金额（应还金额）
    @Column(name = "select_amount")
    private BigDecimal selectAmount;

    // 选择的期限
    @Column(name = "select_time_limit")
    private Integer selectTimeLimit;

    // 逾期天数（还清之后会写入）
    @Column(name = "overdue_day")
    private Integer overdueDay;

    // 逾期金额（还清之后会写入）
    @Column(name = "overdue_amount")
    private BigDecimal overdueAmount;

    // 实际还款金额
    @Column(name = "actual_payment")
    private BigDecimal actualPayment;

    // 失败原因
    @Column(name = "return_reason")
    private String returnReason;

    // 放款状态：0未申请，1放款成功、-1放款失败（重新绑定银行卡），2审核中 ，3风控拒绝，4重新申请,5等待提取，6借款关闭
    @Column(name = "lending_state")
    private Integer lendingState;

    // 机审结果  1 通过  3拒绝
    @Column(name = "risk_state")
    private Integer riskState;

    // 还款状态：0未还款  1已还款
    @Column(name = "reimbursement_state")
    private Integer reimbursementState;

    // 申请Id
    @Column(name = "apply_id")
    private String applyId;

    // 用户Id
    @Column(name = "user_id")
    private String userId;

    // 0 安卓 1 ios
    @Column(name = "is_ios")
    private Integer isIos;

    // ip
    @Column(name = "ip")
    private String ip;

    // 设备
    @Column(name = "device_id")
    private String deviceId;

    // 客户收款/系统放款时间
    @Column(name = "loan_time")
    private Date loanTime;

    // 最终还清时间
    @Column(name = "payoff_time")
    private Date payoffTime;

    // 应还款日期
    @Column(name = "repayment_time")
    private Date repaymentTime;

    // 风控审核时间
    @Column(name = "risk_time")
    private Date riskTime;

    // 展期提交时间/展期单子上一笔的放款时间
    @Column(name = "rollover_time")
    private Date rolloverTime;

    // 便利店最后提取时间
    @Column(name = "extract_time")
    private Date extractTime;

    // 包名
    @Column(name = "package_name")
    private String packageName;

    // 是否展期再生成 0否 1是
    @Column(name = "is_generate")
    private Integer isGenerate;

    // 用户类型
    @Column(name = "user_type")
    private String userType;

    // 广告公司id
    @Column(name = "campaign_id")
    private String campaignId;


}
